<template>
	<view>
		<button @click="login">登录</button>
	</view>
</template>

<script>
	import {
		http
	} from '/tools/http.js'
	import {
		ref,
		toRefs,
		reactive
	} from 'vue';
	export default {
		setup() {
			const login = async () => {
				// http("/user/login", "post", {
				// 	username: "admin",
				// 	password: "111"
				// }).then((res) => {
				// 	console.log(res);
				// }).catch((err) => {
				// 	console.log(err);
				// })


				let data = await http("/user/login", "post", {
					username: "admin",
					password: "111"
				});

				console.log(data);

			}

			return {
				login
			}
		}
	}
</script>

<style scoped>

</style>
